package com.zsy.srpingframework.beans.factory.beanfactory;

import com.zsy.srpingframework.beans.factory.jiekou.SingletonBeanRegistry;

import java.util.HashMap;
import java.util.Map;

public class DefalutSingletonBeanRegistry implements SingletonBeanRegistry {

    private Map<String, Object> singletonBeans = new HashMap<>();
    @Override
    public Object getSingleton(String beanName) {
        return singletonBeans.get(beanName);
    }

    public void addSingleton(String beanName, Object singletonObject) {
        singletonBeans.put(beanName, singletonObject);
    }
}
